/*
 * @(#)RestaurantController.java $version 2011. 5. 19.
 *
 */

package org.doit.android.bobple.server.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.doit.android.bobple.server.bo.RestaurantBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author Choi HongKi
 */
@Controller
public class RestaurantController {
	//	private static final Logger LOGGER = LoggerFactory.getLogger(RestaurantController.class);

	@Autowired
	private RestaurantBO restaurantBO;

	@RequestMapping(value = "/restaurant/getRestaurant")
	public ModelAndView getRestaurant(HttpServletRequest request, HttpServletResponse response) {

		List<Map<String, Object>> testResult = restaurantBO.getRestaurant(request.getParameter("user_id"), Integer.valueOf(request.getParameter("pg_num")), Integer.valueOf(request.getParameter("pg_size")));

		HashMap<String, Object> result = new HashMap<String, Object>();
		result.put("success", true);
		result.put("value", testResult);

		return new ModelAndView("bobpleXMLView", result);
	}
}